Technical Appendix This appendix is intended to provide users of CompuRoc with technical background information that may be useful in constructing simulations and understanding what the results mean. While it's not strictly necessary to read this in order to use CompuRoc effectively, it is helpful in explaining how and why CompuRoc does what it does, and what assumptions and limitations are inherent in the calculations. In doing serious R&D work, it's never advisable to use a computer simulation as a "black box" without a recognition of the assumptions. • Theory CompuRoc is based on a two-dimensional equation of motion for a rocket moving under the influence of (1) its own thrust, (2) the acceleration of gravity, and (3) aerodynamic drag forces. Figure 17 schematically illustrates the different forces acting on the rocket in flight. Newton's second law of motion states that a body's acceleration (a) is proportional to the applied force (F). If m is the mass of the body, then F=ma expresses Newton's second law. If we know the mass and the forces acting on a rocket throughout its flight, then we can determine its acceleration. Since acceleration is the time rate of change of velocity, it is possible, given the initial velocity and acceleration history, to determine the velocity history. This mathematical process is known as integration. Similarly, the velocity history can be integrated to yield the displacement (or altitude) history. This is basically what CompuRoc does. First we shall discuss the nature of the forces assumed by CompuRoc to act on the simulated rocket. The first force, engine thrust, is completely straightforward. The thrust curve data used by CompuRoc is specified directly in Newtons of force (1 Newton is the force required to accelerate a mass of 1 kilogram by 1 m/sec/sec). In this two-dimensional treatment, the forces are described not only by a magnitude but by a direction as well. In the case of thrust this direction varies, pointing always along the rocket's longitudinal axis. The force due to gravity is also simple. It is numerically equal to the mass of the rocket multiplied by the local acceleration of gravity (approximately 9.8 m/sec**2 near the Earth's surface). The force of gravity acts in a fixed (vertical) direction. Thus, if we break up the forces acting on the rocket into perpendicular x and y (horizontal and vertical) components, gravity would enter only in the y-component. In contrast, the x and y thrust components would be Tsinq and Tcosq respectively, where T is the thrust magnitude and q is the angle between the rocket axis and local vertical. As we'll see in more detail below, this angle changes throughout the trajectory, depending on velocity and wind components.   Fig. 17 - Forces acting on rocket in flight The most complicated force acting on the rocket is the drag force, since it is not externally specified like the thrust and gravity, but rather depends directly on the changing state of motion of the rocket itself. Its direction, as in the thrust case, is along the longitudinal symmetry axis, although it acts in the direction opposing motion. It should be noted here that in the presence of wind, the rocket's axis of symmetry will not in general be aligned with the direction of motion. As shown in Fig. 17, the rocket aligns itself with the relative wind , which is just the vector difference between the ambient wind and the rocket's velocity relative to the ground. The aerodynamic drag is assumed to be given by the subsonic drag law, in which the force is proportional to the square of the rocket's airspeed. The drag force D is given by:   Here, CD is the dimensionless drag coefficient, which as noted earlier is usually in the neighborhood of 0.6 to 0.75 for model rockets. The cross-sectional area of the rocket is given by A, and the quantity r denotes the density (mass per unit volume) of the air through which the rocket is moving. The airspeed V is once again the velocity of the rocket relative to moving air (different from ground speed in the case of non-zero wind). This drag formula starts to lose validity as air speed approaches the transonic range (around 220 m/sec at sea level). For transonic and supersonic simulations, CompuRoc approximates the complicated changes in drag properties by changing the effective value of CD in the subsonic drag formula. The commonly assumed form of this supersonic "drag divergence" depends on whether the rocket has a sharp-pointed or blunt nose cone. (While at subsonic speeds, a rounded parabolic nose is best, at supersonic speeds the pointed profile has lower drag.) CompuRoc uses these formulae to calculate the effective drag coefficient: sharp-nosed rockets:   round-nosed rockets:   In these equations, M is the Mach number, or the ratio of airspeed to the speed of sound. (These drag formulae are taken from Topics in Advanced Model Rocketry , by Mandell, Caporaso and Bengen, MIT Press 1973.) CompuRoc computes the the rocket's trajectory in a step-by-step "bootstrap" procedure, calculating the next step's position and velocity from the previous step's acceleration and velocity. Therefore the velocity V used in the above drag formula comes from "feeding back" the updated velocities coming out of the calculation. Similarly, the air density r varies in general with elevation and altitude and needs to be updated at each step. The formula used in CompuRoc to calculate the height dependence of air density is based upon the U.S. Standard Atmosphere model of temperature/density variation. Figure 18 shows the way that atmospheric temperature is assumed to vary with altitude. This profile extends up to an altitude of 61 km, which should be more than adequate for all model rocketry and amateur rocketry applications! The lower 10 km in which temperature falls with altitude is the troposphere. Above this are the stratosphere and mesosphere, where the temperature is constant and then increases.   Fig. 18 - U.S. Standard Atmosphere Temperature and Sound Speed Dependence on Altitude At any given altitude, the density and sound speed needed to calculate the drag force are found by using this temperature model and assuming that the air obeys the ideal gas law. If we call Po and ro the reference pressure and density at some standard site (such as sea level), the ideal gas law gives the relationship:   Here, R is the universal gas constant (8.3145 Joule/mole-°K) and m is the mean molecular weight of air (28.97 gram/mole). Given the values of elevation, pressure and temperature at the launch site, CompuRoc calculates the air density at any other altitude. The pressure at some other altitude h is obtained by integrating the temperature profile:   In turn, the sound speed at altitude h (as plotted in Figure 18) is obtained from the expression:   In this equation, the dimensionless constant g is the ratio of specific heats, which for ordinary air turns out to be 1.403. We can now finish writing down the equations of motion that CompuRoc uses. Breaking up all the vectors into x and y components (horizontal and vertical), the position of the rocket at any time is specified by sx and sy. Similarly, velocity and acceleration are given by (vx , vy) and (ax , ay). Using Newton's second law we can write the following coupled simultaneous equations for motion in the x and y directions:     In these equations, w is the wind speed (assumed horizontal), and the pitch angle q is related to the velocity components by tan q = (vx -w)/vy . Notice now that these equations involve only velocity and acceleration explicitly, but not sx and sy. We will therefore have to use a time-stepping procedure in order to integrate the velocities for displacements. Consider a very short time interval Dt. If over that time, the position changes from s(t) to s(t+Dt), the average velocity is just [s(t+Dt)-s(t)]/Dt. By similar arguments, the average acceleration during a time interval of 2Dt is equal to:   If we use these approximate expressions for velocity and acceleration in the above equations of motion, everything will then be in terms of displacement (sx , sy) and we can use the position at one time in order to step to the next. The simplest procedure would be to step sequentially from one time step to the next, using the velocity and acceleration at time t to "project forward" in time to get the position and velocity at t+Dt . There are, however, more accurate procedures for doing such time-stepping, that reduce the amount of error introduced by taking finite time steps. CompuRoc uses the fourth-order Runge-Kutta procedure, which produces results accurate to the full displayed precision in the simulation window. (For more information on the Runge-Kutta method, consult any textbook on numerical analysis.) As "accurate" as CompuRoc's calculations are, a few words of warning about accuracy are in order here. While it would be possible to make the calculations even more precise than this, there's not much point in doing so, since uncertainties in input quantities like drag coefficient and total impulse are considerably greater than the numerical error. For example, a CompuRoc simulation which predicts an altitude of 400 meters is well within within one meter of being numerically "exact", which is better than most tracking data. However, if the rocket's velocity gets much above 200 meters/sec, the approximate drag law used for the "exact" calculation is not strictly valid, and the actual altitude reached may be different by much more than one meter. Even at subsonic speeds, uncertainties in drag coefficient or other launch variables are likely to greatly dominate any numerical errors. • Altitude Tracking Reduction Although CompuRoc is primarily an altitude prediction tool, the 'Tracking Reduction' option provided in the 'File' menu provides a handy utility for computing actual altitudes from range tracking data. The elevation and azimuth angles of the rocket as seen from two stations (separated by a fixed baseline distance) are the input data. (See Figure 19.) Either the Geodesic Method or the Midpoint Method can be used for obtaining an estimate of tracked altitude from a pair of altitude/azimuth measurements on a known baseline. The Geodesic Method has been endorsed by the the NAR for reduction of tracking data in sanctioned competition and record attempts. (In most situations, Geodesic is the best of the two methods, and we recommend its use; however the Midpoint Method has been included for completeness by popular demand.) The details of these methods have been discussed in a number of magazine articles (American Spacemodeling 10/86, Model Rocketeer 6/81 & 9/83).   Fig. 19 - Altitude Reduction Dialog Standard Macintosh editing techniques are used to enter measured angles (and baseline) in the dialog box. When the "Compute" button is pressed, the altitude and track closure are displayed. Since the two sight lines may not actually intersect, the computed altitude is a kind of "best fit" to the tracking data, and the closure percentage is a measure of how badly the sight lines fail to "close". In competition events a closure of 10% or less is generally required for the result to be considered official. The angles should be entered in degrees. Elevation angles must fall between 0° and 90°, while azimuth can range from -360° to +360°. The baseline may be entered in any convenient units, and must be positive. If the baseline is entered in meters, the computed altitude will be in meters as well. • Units and Conversions As mentioned earlier in the manual, CompuRoc makes use of metric units of measurement throughout. Internally, all the calculations are carried out in the MKS (meter-kilogram-second) system, although sometimes derived metric units (such as grams or square centimeters) are used in the user interface for the sake of convenience. The following is a table of conversion factors that may be convenient for translating between metric and other familiar units of measurement. Multiply this: by this factor: To convert to: inches 2.54 centimeters feet 0.3048 meters miles 1609.344 meters sq. inch 6.4516 sq.centimeters pound (force) 4.4482 Newtons ounce (force) 0.27801 Newtons pound (mass) 453.5924 grams ounce (mass) 28.3495 grams slugs 14593.90 grams inches of mercury 33.8 millibars pounds/sq. in. 68.9476 millibars miles/hour 0.44704 meters/sec [degrees Celsius] = (5/9)[degrees Fahrenheit - 32]